<!DOCTYPE html>

<html lang="en" data-content_root="./">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />

    <title>pyTDFSDK package &#8212; pyTDFSDK 0.4.1 documentation</title>
    <link rel="stylesheet" type="text/css" href="_static/pygments.css?v=d1102ebc" />
    <link rel="stylesheet" type="text/css" href="_static/basic.css?v=c058f7c8" />
    <link rel="stylesheet" type="text/css" href="_static/alabaster.css?v=27fed22d" />
    <script src="_static/documentation_options.js?v=c87aa342"></script>
    <script src="_static/doctools.js?v=9a2dae69"></script>
    <script src="_static/sphinx_highlight.js?v=dc90522c"></script>
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
   
  <link rel="stylesheet" href="_static/custom.css" type="text/css" />
  

  
  

  </head><body>
  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          

          <div class="body" role="main">
            
  <section id="pytdfsdk-package">
<h1>pyTDFSDK package<a class="headerlink" href="#pytdfsdk-package" title="Link to this heading">¶</a></h1>
<section id="submodules">
<h2>Submodules<a class="headerlink" href="#submodules" title="Link to this heading">¶</a></h2>
</section>
<section id="module-pyTDFSDK.classes">
<span id="pytdfsdk-classes-module"></span><h2>pyTDFSDK.classes module<a class="headerlink" href="#module-pyTDFSDK.classes" title="Link to this heading">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="pyTDFSDK.classes.TdfData">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">pyTDFSDK.classes.</span></span><span class="sig-name descname"><span class="pre">TdfData</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">bruker_d_folder_name</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">tdf_sdk</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">use_recalibrated_state</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">pressure_compensation_strategy</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">PressureCompensationStrategy.AnalyisGlobalPressureCompensation</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">sql_chunksize</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1000</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.classes.TdfData" title="Link to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>Class containing metadata from TDF files and methods from TDF-SDK library to work with TDF format data.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>bruker_d_folder_name</strong> (<em>str</em>) – Path to a Bruker .d directory containing analysis.tdf.</p></li>
<li><p><strong>tdf_sdk</strong> (<em>ctypes.CDLL</em>) – Library initialized by pyTDFSDK.init_tdf_sdk.init_tdf_sdk_api().</p></li>
<li><p><strong>use_recalibrated_state</strong> (<em>bool</em>) – Whether to use recalibrated data (True) or not (False), defaults to True.</p></li>
<li><p><strong>pressure_compensation_strategy</strong> (<em>enum.Enum</em>) – Pressure compensation when opening TDF data
(pyTDFSDK.ctypes_data_structures.PressureCompensationStrategy.NoPressureCompensation = None,
pyTDFSDK.ctypes_data_structures.PressureCompensationStrategy.AnalyisGlobalPressureCompensation = analysis
global pressure compensation,
pyTDFSDK.ctypes_data_structures.PressureCompensationStrategy.PerFramePressureCompensation = per frame pressure
compensation), defaults to Global Pressure Compensation.</p></li>
<li><p><strong>sql_chunksize</strong> (<em>int</em>) – Number of rows to read from SQL database query at once when reading tables/views from
analysis.tdf.</p></li>
</ul>
</dd>
</dl>
<dl class="py method">
<dt class="sig sig-object py" id="pyTDFSDK.classes.TdfData.close_sql_connection">
<span class="sig-name descname"><span class="pre">close_sql_connection</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.classes.TdfData.close_sql_connection" title="Link to this definition">¶</a></dt>
<dd><p>Close the connection to analysis.tdf.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pyTDFSDK.classes.TdfData.get_db_tables">
<span class="sig-name descname"><span class="pre">get_db_tables</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">sql_chunksize</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1000</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.classes.TdfData.get_db_tables" title="Link to this definition">¶</a></dt>
<dd><p>Get a dictionary of all tables found in the analysis.tdf SQLite database in which the table names act as keys
and the tables as a pandas.DataFrame of values; this is stored in pyTDFSDK.classes.TdfData.analysis.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>sql_chunksize</strong> (<em>int</em>) – Number of rows to read from SQL database query at once when reading tables/views from
analysis.tdf.</p>
</dd>
</dl>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="pyTDFSDK.classes.TdfSpectrum">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">pyTDFSDK.classes.</span></span><span class="sig-name descname"><span class="pre">TdfSpectrum</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tdf_data</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">frame</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mode</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">precursor</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">diapasef_window</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">profile_bins</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mz_encoding</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">64</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">intensity_encoding</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">64</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mobility_encoding</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">64</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">exclude_mobility</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.classes.TdfSpectrum" title="Link to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>Class for parsing and storing spectrum metadata and data arrays from TDF format data.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>tdf_data</strong> (<a class="reference internal" href="#pyTDFSDK.classes.TdfData" title="pyTDFSDK.classes.TdfData"><em>pyTDFSDK.classes.TdfData</em></a>) – TdfData object containing metadata from analysis.tdf database.</p></li>
<li><p><strong>frame</strong> (<em>int</em>) – ID of the frame of interest.</p></li>
<li><p><strong>mode</strong> (<em>str</em>) – Data array mode, either “profile”, “centroid”, or “raw”.</p></li>
<li><p><strong>precursor</strong> (<em>int</em>) – ID of the precursor of interest for ddaPASEF data. If specified, overrides the frame ID during
data parsing.</p></li>
<li><p><strong>diapasef_window</strong> (<em>dict</em>) – Dictionary containing a row of metadata from the
pyTDFSDK.classesTdfData.analysis[‘DiaFrameMsMsWindows’] table required for parsing diaPASEF data.</p></li>
<li><p><strong>profile_bins</strong> (<em>int</em>) – Number of bins to bin spectrum to.</p></li>
<li><p><strong>mz_encoding</strong> (<em>int</em>) – m/z encoding command line parameter, either “64” or “32”.</p></li>
<li><p><strong>intensity_encoding</strong> (<em>int</em>) – Intensity encoding command line parameter, either “64” or “32”.</p></li>
<li><p><strong>mobility_encoding</strong> (<em>int</em>) – Mobility encoding command line parameter, either “64” or “32”.</p></li>
</ul>
</dd>
</dl>
<dl class="py method">
<dt class="sig sig-object py" id="pyTDFSDK.classes.TdfSpectrum.get_ddapasef_precursor_data">
<span class="sig-name descname"><span class="pre">get_ddapasef_precursor_data</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.classes.TdfSpectrum.get_ddapasef_precursor_data" title="Link to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pyTDFSDK.classes.TdfSpectrum.get_lcms_tdf_data">
<span class="sig-name descname"><span class="pre">get_lcms_tdf_data</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.classes.TdfSpectrum.get_lcms_tdf_data" title="Link to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pyTDFSDK.classes.TdfSpectrum.get_maldi_tdf_data">
<span class="sig-name descname"><span class="pre">get_maldi_tdf_data</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.classes.TdfSpectrum.get_maldi_tdf_data" title="Link to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="pyTDFSDK.classes.TsfData">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">pyTDFSDK.classes.</span></span><span class="sig-name descname"><span class="pre">TsfData</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">bruker_d_folder_name</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">tdf_sdk</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">use_recalibrated_state</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">sql_chunksize</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1000</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.classes.TsfData" title="Link to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>Class containing metadata from TSF files and methods from TDF-SDK library to work with TSF format data.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>bruker_d_folder_name</strong> (<em>str</em>) – Path to a Bruker .d directory containing analysis.tsf.</p></li>
<li><p><strong>tdf_sdk</strong> (<em>ctypes.CDLL</em>) – Library initialized by pyTDFSDK.init_tdf_sdk.init_tdf_sdk_api().</p></li>
<li><p><strong>use_recalibrated_state</strong> (<em>bool</em>) – Whether to use recalibrated data (True) or not (False), defaults to True.</p></li>
<li><p><strong>sql_chunksize</strong> (<em>int</em>) – Number of rows to read from SQL database query at once when reading tables/views from
analysis.tsf.</p></li>
</ul>
</dd>
</dl>
<dl class="py method">
<dt class="sig sig-object py" id="pyTDFSDK.classes.TsfData.close_sql_connection">
<span class="sig-name descname"><span class="pre">close_sql_connection</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.classes.TsfData.close_sql_connection" title="Link to this definition">¶</a></dt>
<dd><p>Close the connection to analysis.tsf.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pyTDFSDK.classes.TsfData.get_db_tables">
<span class="sig-name descname"><span class="pre">get_db_tables</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">sql_chunksize</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1000</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.classes.TsfData.get_db_tables" title="Link to this definition">¶</a></dt>
<dd><p>Get a dictionary of all tables found in the analysis.tsf SQLite database in which the table names act as keys
and the tables as a pandas.DataFrame of values; this is stored in pyTDFSDK.classes.TsfData.analysis.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>sql_chunksize</strong> (<em>int</em>) – Number of rows to read from SQL database query at once when reading tables/views from
analysis.tsf.</p>
</dd>
</dl>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="pyTDFSDK.classes.TsfSpectrum">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">pyTDFSDK.classes.</span></span><span class="sig-name descname"><span class="pre">TsfSpectrum</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tsf_data</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">frame</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mode</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">profile_bins</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mz_encoding</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">64</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">intensity_encoding</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">64</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.classes.TsfSpectrum" title="Link to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>Class for parsing and storing spectrum metadata and data arrays from TSF format data.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>tsf_data</strong> (<a class="reference internal" href="#pyTDFSDK.classes.TsfData" title="pyTDFSDK.classes.TsfData"><em>pyTDFSDK.classes.TsfData</em></a>) – TsfData object containing metadata from analysis.tsf database.</p></li>
<li><p><strong>frame</strong> (<em>int</em>) – ID of the frame of interest.</p></li>
<li><p><strong>mode</strong> (<em>str</em>) – Data array mode, either “profile”, “centroid”, or “raw”.</p></li>
<li><p><strong>profile_bins</strong> (<em>int</em>) – Number of bins to bin spectrum to.</p></li>
<li><p><strong>mz_encoding</strong> (<em>int</em>) – m/z encoding command line parameter, either “64” or “32”.</p></li>
<li><p><strong>intensity_encoding</strong> (<em>int</em>) – Intensity encoding command line parameter, either “64” or “32”.</p></li>
</ul>
</dd>
</dl>
<dl class="py method">
<dt class="sig sig-object py" id="pyTDFSDK.classes.TsfSpectrum.get_lcms_tsf_data">
<span class="sig-name descname"><span class="pre">get_lcms_tsf_data</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.classes.TsfSpectrum.get_lcms_tsf_data" title="Link to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pyTDFSDK.classes.TsfSpectrum.get_maldi_tsf_data">
<span class="sig-name descname"><span class="pre">get_maldi_tsf_data</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.classes.TsfSpectrum.get_maldi_tsf_data" title="Link to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</section>
<section id="module-pyTDFSDK.ctypes_data_structures">
<span id="pytdfsdk-ctypes-data-structures-module"></span><h2>pyTDFSDK.ctypes_data_structures module<a class="headerlink" href="#module-pyTDFSDK.ctypes_data_structures" title="Link to this heading">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="pyTDFSDK.ctypes_data_structures.ChromatogramJob">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">pyTDFSDK.ctypes_data_structures.</span></span><span class="sig-name descname"><span class="pre">ChromatogramJob</span></span><a class="headerlink" href="#pyTDFSDK.ctypes_data_structures.ChromatogramJob" title="Link to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">Structure</span></code></p>
<p>ctypes.Structure to hold chromatogram job information.</p>
<dl class="py attribute">
<dt class="sig sig-object py" id="pyTDFSDK.ctypes_data_structures.ChromatogramJob.id">
<span class="sig-name descname"><span class="pre">id</span></span><a class="headerlink" href="#pyTDFSDK.ctypes_data_structures.ChromatogramJob.id" title="Link to this definition">¶</a></dt>
<dd><p>Structure/Union member</p>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="pyTDFSDK.ctypes_data_structures.ChromatogramJob.mz_max">
<span class="sig-name descname"><span class="pre">mz_max</span></span><a class="headerlink" href="#pyTDFSDK.ctypes_data_structures.ChromatogramJob.mz_max" title="Link to this definition">¶</a></dt>
<dd><p>Structure/Union member</p>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="pyTDFSDK.ctypes_data_structures.ChromatogramJob.mz_min">
<span class="sig-name descname"><span class="pre">mz_min</span></span><a class="headerlink" href="#pyTDFSDK.ctypes_data_structures.ChromatogramJob.mz_min" title="Link to this definition">¶</a></dt>
<dd><p>Structure/Union member</p>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="pyTDFSDK.ctypes_data_structures.ChromatogramJob.ook0_max">
<span class="sig-name descname"><span class="pre">ook0_max</span></span><a class="headerlink" href="#pyTDFSDK.ctypes_data_structures.ChromatogramJob.ook0_max" title="Link to this definition">¶</a></dt>
<dd><p>Structure/Union member</p>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="pyTDFSDK.ctypes_data_structures.ChromatogramJob.ook0_min">
<span class="sig-name descname"><span class="pre">ook0_min</span></span><a class="headerlink" href="#pyTDFSDK.ctypes_data_structures.ChromatogramJob.ook0_min" title="Link to this definition">¶</a></dt>
<dd><p>Structure/Union member</p>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="pyTDFSDK.ctypes_data_structures.ChromatogramJob.time_begin">
<span class="sig-name descname"><span class="pre">time_begin</span></span><a class="headerlink" href="#pyTDFSDK.ctypes_data_structures.ChromatogramJob.time_begin" title="Link to this definition">¶</a></dt>
<dd><p>Structure/Union member</p>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="pyTDFSDK.ctypes_data_structures.ChromatogramJob.time_end">
<span class="sig-name descname"><span class="pre">time_end</span></span><a class="headerlink" href="#pyTDFSDK.ctypes_data_structures.ChromatogramJob.time_end" title="Link to this definition">¶</a></dt>
<dd><p>Structure/Union member</p>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="pyTDFSDK.ctypes_data_structures.PressureCompensationStrategy">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">pyTDFSDK.ctypes_data_structures.</span></span><span class="sig-name descname"><span class="pre">PressureCompensationStrategy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">value</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">names</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">*</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">module</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">qualname</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">type</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">start</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">boundary</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.ctypes_data_structures.PressureCompensationStrategy" title="Link to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">Enum</span></code></p>
<p>enum.Enum to determine pressure compensation strategy.</p>
<dl class="py attribute">
<dt class="sig sig-object py" id="pyTDFSDK.ctypes_data_structures.PressureCompensationStrategy.AnalyisGlobalPressureCompensation">
<span class="sig-name descname"><span class="pre">AnalyisGlobalPressureCompensation</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">1</span></em><a class="headerlink" href="#pyTDFSDK.ctypes_data_structures.PressureCompensationStrategy.AnalyisGlobalPressureCompensation" title="Link to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="pyTDFSDK.ctypes_data_structures.PressureCompensationStrategy.NoPressureCompensation">
<span class="sig-name descname"><span class="pre">NoPressureCompensation</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">0</span></em><a class="headerlink" href="#pyTDFSDK.ctypes_data_structures.PressureCompensationStrategy.NoPressureCompensation" title="Link to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="pyTDFSDK.ctypes_data_structures.PressureCompensationStrategy.PerFramePressureCompensation">
<span class="sig-name descname"><span class="pre">PerFramePressureCompensation</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">2</span></em><a class="headerlink" href="#pyTDFSDK.ctypes_data_structures.PressureCompensationStrategy.PerFramePressureCompensation" title="Link to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="pyTDFSDK.ctypes_data_structures.TimsVisExtractionFilter">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">pyTDFSDK.ctypes_data_structures.</span></span><span class="sig-name descname"><span class="pre">TimsVisExtractionFilter</span></span><a class="headerlink" href="#pyTDFSDK.ctypes_data_structures.TimsVisExtractionFilter" title="Link to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">Structure</span></code></p>
<p>ctypes.Structure to hold visualization extraction filter information.</p>
<dl class="py attribute">
<dt class="sig sig-object py" id="pyTDFSDK.ctypes_data_structures.TimsVisExtractionFilter.mzLower">
<span class="sig-name descname"><span class="pre">mzLower</span></span><a class="headerlink" href="#pyTDFSDK.ctypes_data_structures.TimsVisExtractionFilter.mzLower" title="Link to this definition">¶</a></dt>
<dd><p>Structure/Union member</p>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="pyTDFSDK.ctypes_data_structures.TimsVisExtractionFilter.mzUpper">
<span class="sig-name descname"><span class="pre">mzUpper</span></span><a class="headerlink" href="#pyTDFSDK.ctypes_data_structures.TimsVisExtractionFilter.mzUpper" title="Link to this definition">¶</a></dt>
<dd><p>Structure/Union member</p>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="pyTDFSDK.ctypes_data_structures.TimsVisExtractionFilter.ook0Lower">
<span class="sig-name descname"><span class="pre">ook0Lower</span></span><a class="headerlink" href="#pyTDFSDK.ctypes_data_structures.TimsVisExtractionFilter.ook0Lower" title="Link to this definition">¶</a></dt>
<dd><p>Structure/Union member</p>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="pyTDFSDK.ctypes_data_structures.TimsVisExtractionFilter.ook0Upper">
<span class="sig-name descname"><span class="pre">ook0Upper</span></span><a class="headerlink" href="#pyTDFSDK.ctypes_data_structures.TimsVisExtractionFilter.ook0Upper" title="Link to this definition">¶</a></dt>
<dd><p>Structure/Union member</p>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="pyTDFSDK.ctypes_data_structures.TimsVisExtractionFilter.rtSecondsLower">
<span class="sig-name descname"><span class="pre">rtSecondsLower</span></span><a class="headerlink" href="#pyTDFSDK.ctypes_data_structures.TimsVisExtractionFilter.rtSecondsLower" title="Link to this definition">¶</a></dt>
<dd><p>Structure/Union member</p>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="pyTDFSDK.ctypes_data_structures.TimsVisExtractionFilter.rtSecondsUpper">
<span class="sig-name descname"><span class="pre">rtSecondsUpper</span></span><a class="headerlink" href="#pyTDFSDK.ctypes_data_structures.TimsVisExtractionFilter.rtSecondsUpper" title="Link to this definition">¶</a></dt>
<dd><p>Structure/Union member</p>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="pyTDFSDK.ctypes_data_structures.TimsVisHeatmapSizes">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">pyTDFSDK.ctypes_data_structures.</span></span><span class="sig-name descname"><span class="pre">TimsVisHeatmapSizes</span></span><a class="headerlink" href="#pyTDFSDK.ctypes_data_structures.TimsVisHeatmapSizes" title="Link to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">Structure</span></code></p>
<p>ctypes.Structure to hold heatmap size information.</p>
<dl class="py attribute">
<dt class="sig sig-object py" id="pyTDFSDK.ctypes_data_structures.TimsVisHeatmapSizes.heightMobMz">
<span class="sig-name descname"><span class="pre">heightMobMz</span></span><a class="headerlink" href="#pyTDFSDK.ctypes_data_structures.TimsVisHeatmapSizes.heightMobMz" title="Link to this definition">¶</a></dt>
<dd><p>Structure/Union member</p>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="pyTDFSDK.ctypes_data_structures.TimsVisHeatmapSizes.heightRtMob">
<span class="sig-name descname"><span class="pre">heightRtMob</span></span><a class="headerlink" href="#pyTDFSDK.ctypes_data_structures.TimsVisHeatmapSizes.heightRtMob" title="Link to this definition">¶</a></dt>
<dd><p>Structure/Union member</p>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="pyTDFSDK.ctypes_data_structures.TimsVisHeatmapSizes.heightRtMz">
<span class="sig-name descname"><span class="pre">heightRtMz</span></span><a class="headerlink" href="#pyTDFSDK.ctypes_data_structures.TimsVisHeatmapSizes.heightRtMz" title="Link to this definition">¶</a></dt>
<dd><p>Structure/Union member</p>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="pyTDFSDK.ctypes_data_structures.TimsVisHeatmapSizes.widthMobMz">
<span class="sig-name descname"><span class="pre">widthMobMz</span></span><a class="headerlink" href="#pyTDFSDK.ctypes_data_structures.TimsVisHeatmapSizes.widthMobMz" title="Link to this definition">¶</a></dt>
<dd><p>Structure/Union member</p>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="pyTDFSDK.ctypes_data_structures.TimsVisHeatmapSizes.widthRtMob">
<span class="sig-name descname"><span class="pre">widthRtMob</span></span><a class="headerlink" href="#pyTDFSDK.ctypes_data_structures.TimsVisHeatmapSizes.widthRtMob" title="Link to this definition">¶</a></dt>
<dd><p>Structure/Union member</p>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="pyTDFSDK.ctypes_data_structures.TimsVisHeatmapSizes.widthRtMz">
<span class="sig-name descname"><span class="pre">widthRtMz</span></span><a class="headerlink" href="#pyTDFSDK.ctypes_data_structures.TimsVisHeatmapSizes.widthRtMz" title="Link to this definition">¶</a></dt>
<dd><p>Structure/Union member</p>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="pyTDFSDK.ctypes_data_structures.TimsVisLine">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">pyTDFSDK.ctypes_data_structures.</span></span><span class="sig-name descname"><span class="pre">TimsVisLine</span></span><a class="headerlink" href="#pyTDFSDK.ctypes_data_structures.TimsVisLine" title="Link to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">Structure</span></code></p>
<p>ctypes.Structure to hold visualization x-y coordinates.</p>
<dl class="py attribute">
<dt class="sig sig-object py" id="pyTDFSDK.ctypes_data_structures.TimsVisLine.x0">
<span class="sig-name descname"><span class="pre">x0</span></span><a class="headerlink" href="#pyTDFSDK.ctypes_data_structures.TimsVisLine.x0" title="Link to this definition">¶</a></dt>
<dd><p>Structure/Union member</p>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="pyTDFSDK.ctypes_data_structures.TimsVisLine.x1">
<span class="sig-name descname"><span class="pre">x1</span></span><a class="headerlink" href="#pyTDFSDK.ctypes_data_structures.TimsVisLine.x1" title="Link to this definition">¶</a></dt>
<dd><p>Structure/Union member</p>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="pyTDFSDK.ctypes_data_structures.TimsVisLine.y0">
<span class="sig-name descname"><span class="pre">y0</span></span><a class="headerlink" href="#pyTDFSDK.ctypes_data_structures.TimsVisLine.y0" title="Link to this definition">¶</a></dt>
<dd><p>Structure/Union member</p>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="pyTDFSDK.ctypes_data_structures.TimsVisLine.y1">
<span class="sig-name descname"><span class="pre">y1</span></span><a class="headerlink" href="#pyTDFSDK.ctypes_data_structures.TimsVisLine.y1" title="Link to this definition">¶</a></dt>
<dd><p>Structure/Union member</p>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="pyTDFSDK.ctypes_data_structures.TimsVisTransformation">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">pyTDFSDK.ctypes_data_structures.</span></span><span class="sig-name descname"><span class="pre">TimsVisTransformation</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">value</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">names</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">*</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">module</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">qualname</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">type</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">start</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">boundary</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.ctypes_data_structures.TimsVisTransformation" title="Link to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">Enum</span></code></p>
<p>enum.Enum to determine MSI visualization intensity transformation method.</p>
<dl class="py attribute">
<dt class="sig sig-object py" id="pyTDFSDK.ctypes_data_structures.TimsVisTransformation.LIMITED_LOG">
<span class="sig-name descname"><span class="pre">LIMITED_LOG</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">2</span></em><a class="headerlink" href="#pyTDFSDK.ctypes_data_structures.TimsVisTransformation.LIMITED_LOG" title="Link to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="pyTDFSDK.ctypes_data_structures.TimsVisTransformation.NONE">
<span class="sig-name descname"><span class="pre">NONE</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">0</span></em><a class="headerlink" href="#pyTDFSDK.ctypes_data_structures.TimsVisTransformation.NONE" title="Link to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="pyTDFSDK.ctypes_data_structures.TimsVisTransformation.SQRT">
<span class="sig-name descname"><span class="pre">SQRT</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">1</span></em><a class="headerlink" href="#pyTDFSDK.ctypes_data_structures.TimsVisTransformation.SQRT" title="Link to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</section>
<section id="module-pyTDFSDK.error">
<span id="pytdfsdk-error-module"></span><h2>pyTDFSDK.error module<a class="headerlink" href="#module-pyTDFSDK.error" title="Link to this heading">¶</a></h2>
<dl class="py function">
<dt class="sig sig-object py" id="pyTDFSDK.error.throw_last_timsdata_error">
<span class="sig-prename descclassname"><span class="pre">pyTDFSDK.error.</span></span><span class="sig-name descname"><span class="pre">throw_last_timsdata_error</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tdf_sdk</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.error.throw_last_timsdata_error" title="Link to this definition">¶</a></dt>
<dd><p>Return the last error as a string (thread-local) while throwing exception from TDF data.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>tdf_sdk</strong> (<em>ctypes.CDLL</em>) – Instance of TDF-SDK.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Runtime error.</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pyTDFSDK.error.throw_last_timsvis_error">
<span class="sig-prename descclassname"><span class="pre">pyTDFSDK.error.</span></span><span class="sig-name descname"><span class="pre">throw_last_timsvis_error</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tdf_sdk</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.error.throw_last_timsvis_error" title="Link to this definition">¶</a></dt>
<dd><p>Return the last error as a string (thread-local) while throwing exception from TDF/TSF data.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>tdf_sdk</strong> (<em>ctypes.CDLL</em>) – Instance of TDF-SDK.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Runtime error.</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pyTDFSDK.error.throw_last_tsfdata_error">
<span class="sig-prename descclassname"><span class="pre">pyTDFSDK.error.</span></span><span class="sig-name descname"><span class="pre">throw_last_tsfdata_error</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tdf_sdk</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.error.throw_last_tsfdata_error" title="Link to this definition">¶</a></dt>
<dd><p>Return the last error as a string (thread-local) while throwing exception from TSF data.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>tdf_sdk</strong> (<em>ctypes.CDLL</em>) – Instance of TDF-SDK.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Runtime error.</p>
</dd>
</dl>
</dd></dl>

</section>
<section id="module-pyTDFSDK.init_tdf_sdk">
<span id="pytdfsdk-init-tdf-sdk-module"></span><h2>pyTDFSDK.init_tdf_sdk module<a class="headerlink" href="#module-pyTDFSDK.init_tdf_sdk" title="Link to this heading">¶</a></h2>
<dl class="py function">
<dt class="sig sig-object py" id="pyTDFSDK.init_tdf_sdk.init_tdf_sdk_api">
<span class="sig-prename descclassname"><span class="pre">pyTDFSDK.init_tdf_sdk.</span></span><span class="sig-name descname"><span class="pre">init_tdf_sdk_api</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">bruker_api_file_name</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">''</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.init_tdf_sdk.init_tdf_sdk_api" title="Link to this definition">¶</a></dt>
<dd><p>Initialize functions from Bruker’s TDF-SDK library using ctypes.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>bruker_api_file_name</strong> (<em>str</em>) – Path to TDF-SDK library, defaults to packaged library paths if no custom paths are
provided.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Handle for TDF-SDK library.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>ctypes.CDLL</p>
</dd>
</dl>
</dd></dl>

</section>
<section id="module-pyTDFSDK.tims">
<span id="pytdfsdk-tims-module"></span><h2>pyTDFSDK.tims module<a class="headerlink" href="#module-pyTDFSDK.tims" title="Link to this heading">¶</a></h2>
<dl class="py function">
<dt class="sig sig-object py" id="pyTDFSDK.tims.extract_2d_tdf_spectrum">
<span class="sig-prename descclassname"><span class="pre">pyTDFSDK.tims.</span></span><span class="sig-name descname"><span class="pre">extract_2d_tdf_spectrum</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tdf_data</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">frame</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">scan_begin</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">scan_end</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mode</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">profile_bins</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mz_encoding</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">64</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">intensity_encoding</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">64</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.tims.extract_2d_tdf_spectrum" title="Link to this definition">¶</a></dt>
<dd><p>Extract spectrum from TDF data with m/z and intensity arrays. Spectrum can either be centroid or quasi-profile
mode. “Raw” mode uses pyTDFSDK.tims.tims_read_scans_v2() method, while “centroid” mode uses
pyTDFSDK.tims.tims_extract_centroided_spectrum_for_frame_v2() method. “Profile” mode uses
pyTDFSDK.tims.tims_extract_profile_for_frame() to extrapolate a quasi-profile spectrum from centroid raw data.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>tdf_data</strong> (<a class="reference internal" href="#pyTDFSDK.classes.TdfData" title="pyTDFSDK.classes.TdfData"><em>pyTDFSDK.classes.TdfData</em></a>) – tdf_data object containing metadata from analysis.tdf database.</p></li>
<li><p><strong>frame</strong> (<em>int</em>) – Frame ID from the Frames table in analysis.tdf/analysis.tsf database.</p></li>
<li><p><strong>scan_begin</strong> (<em>int</em>) – Beginning scan number (corresponding to 1/K0 value) within frame.</p></li>
<li><p><strong>scan_end</strong> (<em>int</em>) – Ending scan number (corresponding to 1/K0 value) within frame (non-inclusive).</p></li>
<li><p><strong>mode</strong> (<em>str</em>) – Mode command line parameter, either “profile”, “centroid”, or “raw”.</p></li>
<li><p><strong>profile_bins</strong> (<em>int</em>) – Number of bins to bin spectrum to.</p></li>
<li><p><strong>mz_encoding</strong> (<em>int</em>) – m/z encoding command line parameter, either “64” or “32”.</p></li>
<li><p><strong>intensity_encoding</strong> (<em>int</em>) – Intensity encoding command line parameter, either “64” or “32”.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Tuple of mz_array (np.array) and intensity_array (np.array) or (None, None) if spectra are empty.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>tuple[numpy.array | None]</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pyTDFSDK.tims.extract_3d_tdf_spectrum">
<span class="sig-prename descclassname"><span class="pre">pyTDFSDK.tims.</span></span><span class="sig-name descname"><span class="pre">extract_3d_tdf_spectrum</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tdf_data</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">frame</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">scan_begin</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">scan_end</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.tims.extract_3d_tdf_spectrum" title="Link to this definition">¶</a></dt>
<dd><p>Extract spectrum from TDF data with m/z and intensity arrays. Spectrum can either be centroid or quasi-profile
mode. “Raw” and “centroid” modes uses pyTDFSDK.tims.tims_read_scans_v2(). “Profile” mode data is not available due
to the resulting data size.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>tdf_data</strong> (<a class="reference internal" href="#pyTDFSDK.classes.TdfData" title="pyTDFSDK.classes.TdfData"><em>pyTDFSDK.classes.TdfData</em></a>) – tdf_data object containing metadata from analysis.tdf database.</p></li>
<li><p><strong>frame</strong> (<em>int</em>) – Frame ID from the Frames table in analysis.tdf/analysis.tsf database.</p></li>
<li><p><strong>scan_begin</strong> (<em>int</em>) – Beginning scan number (corresponding to 1/K0 value) within frame.</p></li>
<li><p><strong>scan_end</strong> (<em>int</em>) – Ending scan number (corresponding to 1/K0 value) within frame (non-inclusive).</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Tuple of mz_array (np.array), intensity_array (np.array), and mobility_array (np.array) or
(None, None, None) if spectra are empty.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>tuple[numpy.array | None]</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pyTDFSDK.tims.extract_ddapasef_precursor_spectrum">
<span class="sig-prename descclassname"><span class="pre">pyTDFSDK.tims.</span></span><span class="sig-name descname"><span class="pre">extract_ddapasef_precursor_spectrum</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tdf_data</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">pasefframemsmsinfo_dicts</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mode</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">profile_bins</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mz_encoding</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">intensity_encoding</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.tims.extract_ddapasef_precursor_spectrum" title="Link to this definition">¶</a></dt>
<dd><p>Extract spectrum from TDF data with m/z and intensity arrays. Spectrum can either be centroid or quasi-profile
mode. “Raw” mode uses pyTDFSDK.tims.tims_read_scans_v2() method, while “centroid” mode uses
pyTDFSDK.tims.tims_extract_centroided_spectrum_for_frame_v2() method. “Profile” mode uses
pyTDFSDK.tims.tims_extract_profile_for_frame() to extrapolate a quasi-profile spectrum from centroid raw data.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>tdf_data</strong> (<a class="reference internal" href="#pyTDFSDK.classes.TdfData" title="pyTDFSDK.classes.TdfData"><em>pyTDFSDK.classes.TdfData</em></a>) – tdf_data object containing metadata from analysis.tdf database.</p></li>
<li><p><strong>pasefframemsmsinfo_dicts</strong> (<em>dict</em>) – A row from the PasefFrameMsmsInfo table in analysis.tdf database.</p></li>
<li><p><strong>mode</strong> (<em>str</em>) – Mode command line parameter, either “profile”, “centroid”, or “raw”.</p></li>
<li><p><strong>profile_bins</strong> (<em>int</em>) – Number of bins to bin spectrum to.</p></li>
<li><p><strong>mz_encoding</strong> (<em>int</em>) – m/z encoding command line parameter, either “64” or “32”.</p></li>
<li><p><strong>intensity_encoding</strong> (<em>int</em>) – Intensity encoding command line parameter, either “64” or “32”.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Tuple of mz_array (np.array) and intensity_array (np.array) or (None, None) if spectra are empty.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>tuple[numpy.array | None</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pyTDFSDK.tims.tims_ccs_to_oneoverk0_for_mz">
<span class="sig-prename descclassname"><span class="pre">pyTDFSDK.tims.</span></span><span class="sig-name descname"><span class="pre">tims_ccs_to_oneoverk0_for_mz</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tdf_sdk</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ccs</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">charge</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mz</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.tims.tims_ccs_to_oneoverk0_for_mz" title="Link to this definition">¶</a></dt>
<dd><p>Convert collisional cross section (CCS) values to 1/K0 values based on a feature’s m/z value and charge.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>tdf_sdk</strong> (<em>ctypes.CDLL</em>) – Library initialized by pyTDFSDK.init_tdf_sdk.init_tdf_sdk_api().</p></li>
<li><p><strong>ccs</strong> (<em>float</em>) – Collisional cross section (CCS) value of the feature.</p></li>
<li><p><strong>charge</strong> (<em>int</em>) – Charge of the feature.</p></li>
<li><p><strong>mz</strong> (<em>float</em>) – m/z value of the feature.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>1/K0 value calculated from the provided feature.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>float</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pyTDFSDK.tims.tims_close">
<span class="sig-prename descclassname"><span class="pre">pyTDFSDK.tims.</span></span><span class="sig-name descname"><span class="pre">tims_close</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tdf_sdk</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">handle</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">conn</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.tims.tims_close" title="Link to this definition">¶</a></dt>
<dd><p>Close TDF dataset.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>tdf_sdk</strong> (<em>ctypes.CDLL</em>) – Library initialized by pyTDFSDK.init_tdf_sdk.init_tdf_sdk_api().</p></li>
<li><p><strong>handle</strong> (<em>int</em>) – Handle value for TDF dataset initialized using pyTDFSDK.tims.tims_open().</p></li>
<li><p><strong>conn</strong> (<em>sqlite3.Connection</em>) – SQL database connection to analysis.tdf.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Tuple of the handle and connection.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>tuple</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pyTDFSDK.tims.tims_extract_centroided_spectrum_for_frame_ext">
<span class="sig-prename descclassname"><span class="pre">pyTDFSDK.tims.</span></span><span class="sig-name descname"><span class="pre">tims_extract_centroided_spectrum_for_frame_ext</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tdf_sdk</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">handle</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">frame_id</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">scan_begin</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">scan_end</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">peak_picker_resolution</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.tims.tims_extract_centroided_spectrum_for_frame_ext" title="Link to this definition">¶</a></dt>
<dd><p>Read peak picked spectra for a frame from a TIMS (TDF) dataset with a custom peak picker resolution. Same as
pyTDFSDK.tims.tims_extract_centroided_spectrum_for_frame_v2() but with a user supplied resolution for the peak
picker.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>tdf_sdk</strong> (<em>ctypes.CDLL</em>) – Library initialized by pyTDFSDK.init_tdf_sdk.init_tdf_sdk_api().</p></li>
<li><p><strong>handle</strong> (<em>int</em>) – Handle value for TDF dataset initialized using pyTDFSDK.tims.tims_open().</p></li>
<li><p><strong>frame_id</strong> (<em>int</em>) – ID of the frame of interest.</p></li>
<li><p><strong>scan_begin</strong> (<em>int</em>) – Beginning scan number (corresponding to 1/K0 value) within frame.</p></li>
<li><p><strong>scan_end</strong> (<em>int</em>) – Ending scan number (corresponding to 1/K0 value) within frame (non-inclusive).</p></li>
<li><p><strong>peak_picker_resolution</strong> (<em>int</em>) – User supplied resolution for peak picker.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Tuple containing an array of m/z values and an array of detector counts or 0 on error.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>tuple[numpy.array] | int</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pyTDFSDK.tims.tims_extract_centroided_spectrum_for_frame_v2">
<span class="sig-prename descclassname"><span class="pre">pyTDFSDK.tims.</span></span><span class="sig-name descname"><span class="pre">tims_extract_centroided_spectrum_for_frame_v2</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tdf_sdk</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">handle</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">frame_id</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">scan_begin</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">scan_end</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.tims.tims_extract_centroided_spectrum_for_frame_v2" title="Link to this definition">¶</a></dt>
<dd><p>Read peak picked spectra for a frame from a TIMS (TDF) dataset.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>tdf_sdk</strong> (<em>ctypes.CDLL</em>) – Library initialized by pyTDFSDK.init_tdf_sdk.init_tdf_sdk_api().</p></li>
<li><p><strong>handle</strong> (<em>int</em>) – Handle value for TDF dataset initialized using pyTDFSDK.tims.tims_open().</p></li>
<li><p><strong>frame_id</strong> (<em>int</em>) – ID of the frame of interest.</p></li>
<li><p><strong>scan_begin</strong> (<em>int</em>) – Beginning scan number (corresponding to 1/K0 value) within frame.</p></li>
<li><p><strong>scan_end</strong> (<em>int</em>) – Ending scan number (corresponding to 1/K0 value) within frame (non-inclusive).</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Tuple containing an array of m/z values and an array of detector counts or 0 on error.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>tuple[numpy.array] | int</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pyTDFSDK.tims.tims_extract_chromatograms">
<span class="sig-prename descclassname"><span class="pre">pyTDFSDK.tims.</span></span><span class="sig-name descname"><span class="pre">tims_extract_chromatograms</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tdf_sdk</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">handle</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">jobs</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">trace_sink</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.tims.tims_extract_chromatograms" title="Link to this definition">¶</a></dt>
<dd><p>Extract several (MS1-only) chromatograms from an analysis.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>tdf_sdk</strong> (<em>ctypes.CDLL</em>) – Library initialized by pyTDFSDK.init_tdf_sdk.init_tdf_sdk_api().</p></li>
<li><p><strong>handle</strong> – Handle value for TDF dataset initialized using pyTDFSDK.tims.tims_open().</p></li>
<li><p><strong>jobs</strong> – Chromatogram definitions that will be iterated through using the generator function defined in this
function.</p></li>
<li><p><strong>trace_sink</strong> – Sink callback from TDF-SDK.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pyTDFSDK.tims.tims_extract_profile_for_frame">
<span class="sig-prename descclassname"><span class="pre">pyTDFSDK.tims.</span></span><span class="sig-name descname"><span class="pre">tims_extract_profile_for_frame</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tdf_sdk</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">handle</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">frame_id</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">scan_begin</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">scan_end</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.tims.tims_extract_profile_for_frame" title="Link to this definition">¶</a></dt>
<dd><p>Read quasi profile spectra for a frame from a TIMS (TDF) dataset. This function sums the corresponding scan number
ranges into a synthetic profile spectrum.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>tdf_sdk</strong> (<em>ctypes.CDLL</em>) – Library initialized by pyTDFSDK.init_tdf_sdk.init_tdf_sdk_api().</p></li>
<li><p><strong>handle</strong> (<em>int</em>) – Handle value for TDF dataset initialized using pyTDFSDK.tims.tims_open().</p></li>
<li><p><strong>frame_id</strong> (<em>int</em>) – ID of the frame of interest.</p></li>
<li><p><strong>scan_begin</strong> (<em>int</em>) – Beginning scan number (corresponding to 1/K0 value) within frame.</p></li>
<li><p><strong>scan_end</strong> (<em>int</em>) – Ending scan number (corresponding to 1/K0 value) within frame (non-inclusive).</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Array of detector counts or 0 on error.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>numpy.array | int</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pyTDFSDK.tims.tims_has_recalibrated_state">
<span class="sig-prename descclassname"><span class="pre">pyTDFSDK.tims.</span></span><span class="sig-name descname"><span class="pre">tims_has_recalibrated_state</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tdf_sdk</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">handle</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.tims.tims_has_recalibrated_state" title="Link to this definition">¶</a></dt>
<dd><p>Check if the raw data has been recalibrated after acquisition (i.e. in the Bruker DataAnalysis software). Note that
masses and 1/K0 values in the raw data SQLite files are always in the raw calibration state, not the recalibrated
state.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>tdf_sdk</strong> (<em>ctypes.CDLL</em>) – Library initialized by pyTDFSDK.init_tdf_sdk.init_tdf_sdk_api().</p></li>
<li><p><strong>handle</strong> (<em>int</em>) – Handle value for TDF dataset initialized using pyTDFSDK.tims.tims_open().</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>1 if the raw data has been recalibrated after acquisition or 0 if not.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>int</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pyTDFSDK.tims.tims_index_to_mz">
<span class="sig-prename descclassname"><span class="pre">pyTDFSDK.tims.</span></span><span class="sig-name descname"><span class="pre">tims_index_to_mz</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tdf_sdk</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">handle</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">frame_id</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">indices</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.tims.tims_index_to_mz" title="Link to this definition">¶</a></dt>
<dd><p>Convert (possibly non-integer) index values for the mass dimension to m/z values.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>tdf_sdk</strong> (<em>ctypes.CDLL</em>) – Library initialized by pyTDFSDK.init_tdf_sdk.init_tdf_sdk_api().</p></li>
<li><p><strong>handle</strong> (<em>int</em>) – Handle value for TDF dataset initialized using pyTDFSDK.tims.tims_open().</p></li>
<li><p><strong>frame_id</strong> (<em>int</em>) – ID of the frame of interest.</p></li>
<li><p><strong>indices</strong> (<em>numpy.array</em>) – Array of index values to be converted to m/z values.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Array of m/z values.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>numpy.array</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pyTDFSDK.tims.tims_mz_to_index">
<span class="sig-prename descclassname"><span class="pre">pyTDFSDK.tims.</span></span><span class="sig-name descname"><span class="pre">tims_mz_to_index</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tdf_sdk</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">handle</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">frame_id</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mzs</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.tims.tims_mz_to_index" title="Link to this definition">¶</a></dt>
<dd><p>Convert m/z values to (possibly non-integer) index values for the mass dimension.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>tdf_sdk</strong> (<em>ctypes.CDLL</em>) – Library initialized by pyTDFSDK.init_tdf_sdk.init_tdf_sdk_api().</p></li>
<li><p><strong>handle</strong> (<em>int</em>) – Handle value for TDF dataset initialized using pyTDFSDK.tims.tims_open().</p></li>
<li><p><strong>frame_id</strong> (<em>int</em>) – ID of the frame of interest.</p></li>
<li><p><strong>mzs</strong> (<em>numpy.array</em>) – Array of m/z values to be converted to index values.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Array of index values.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>numpy.array</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pyTDFSDK.tims.tims_oneoverk0_to_ccs_for_mz">
<span class="sig-prename descclassname"><span class="pre">pyTDFSDK.tims.</span></span><span class="sig-name descname"><span class="pre">tims_oneoverk0_to_ccs_for_mz</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tdf_sdk</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ook0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">charge</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mz</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.tims.tims_oneoverk0_to_ccs_for_mz" title="Link to this definition">¶</a></dt>
<dd><p>Convert 1/K0 values to collisional cross section values (in Anstrom^2) using the Mason-Shamp equation.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>tdf_sdk</strong> (<em>ctypes.CDLL</em>) – Library initialized by pyTDFSDK.init_tdf_sdk.init_tdf_sdk_api().</p></li>
<li><p><strong>ook0</strong> (<em>float</em>) – 1/K0 value of the feature to be converted.</p></li>
<li><p><strong>charge</strong> (<em>int</em>) – Charge of the feature to be converted.</p></li>
<li><p><strong>mz</strong> (<em>float</em>) – m/z value of the feature to be converted.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Collisional cross section value in Angstrom^2.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>float</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pyTDFSDK.tims.tims_oneoverk0_to_scannum">
<span class="sig-prename descclassname"><span class="pre">pyTDFSDK.tims.</span></span><span class="sig-name descname"><span class="pre">tims_oneoverk0_to_scannum</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tdf_sdk</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">handle</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">frame_id</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mobilities</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.tims.tims_oneoverk0_to_scannum" title="Link to this definition">¶</a></dt>
<dd><p>Convert 1/K0 values to (possibly non-integer) scan numbers for the mobility dimension.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>tdf_sdk</strong> (<em>ctypes.CDLL</em>) – Library initialized by pyTDFSDK.init_tdf_sdk.init_tdf_sdk_api().</p></li>
<li><p><strong>handle</strong> (<em>int</em>) – Handle value for TDF dataset initialized using pyTDFSDK.tims.tims_open().</p></li>
<li><p><strong>frame_id</strong> (<em>int</em>) – ID of the frame of interest.</p></li>
<li><p><strong>mobilities</strong> (<em>numpy.array</em>) – Array of 1/K0 values to be converted to scan numbers.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Array of scan numbers.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>numpy.array</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pyTDFSDK.tims.tims_open">
<span class="sig-prename descclassname"><span class="pre">pyTDFSDK.tims.</span></span><span class="sig-name descname"><span class="pre">tims_open</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tdf_sdk</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">bruker_d_folder_name</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">use_recalibrated_state</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.tims.tims_open" title="Link to this definition">¶</a></dt>
<dd><p>Open TDF dataset and return a non-zero instance handle to be passed to subsequent API calls.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>tdf_sdk</strong> (<em>ctypes.CDLL</em>) – Library initialized by pyTDFSDK.init_tdf_sdk.init_tdf_sdk_api().</p></li>
<li><p><strong>bruker_d_folder_name</strong> (<em>str</em>) – Path to a Bruker .d file containing analysis.tdf.</p></li>
<li><p><strong>use_recalibrated_state</strong> (<em>bool</em>) – Whether to use recalibrated data (True) or not (False), defaults to True.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Non-zero instance handle.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>int</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pyTDFSDK.tims.tims_open_v2">
<span class="sig-prename descclassname"><span class="pre">pyTDFSDK.tims.</span></span><span class="sig-name descname"><span class="pre">tims_open_v2</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tdf_sdk</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">bruker_d_folder_name</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">pressure_compensation_strategy</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">use_recalibrated_state</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.tims.tims_open_v2" title="Link to this definition">¶</a></dt>
<dd><p>Open TDF dataset while taking into account the pressure compensation strategy and return a non-zero instance handle
to be passed to subsequent API calls.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>tdf_sdk</strong> (<em>ctypes.CDLL</em>) – Library initialized by pyTDFSDK.init_tdf_sdk.init_tdf_sdk_api().</p></li>
<li><p><strong>bruker_d_folder_name</strong> (<em>str</em>) – Path to a Bruker .d file containing analysis.tdf.</p></li>
<li><p><strong>pressure_compensation_strategy</strong> (<em>enum.Enum</em>) – Pressure compensation strategy chosen from
pyTDFSDK.ctypes_data_structures.PressureCompensationStrategy, either NoPressureCompensation,
AnalysisGlobalPressureCompensation, or PerFramePressureCompensation.</p></li>
<li><p><strong>use_recalibrated_state</strong> (<em>bool</em>) – Whether to use recalibrated data (True) or not (False), defaults to True.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Non-zero instance handle.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>int</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pyTDFSDK.tims.tims_read_pasef_msms">
<span class="sig-prename descclassname"><span class="pre">pyTDFSDK.tims.</span></span><span class="sig-name descname"><span class="pre">tims_read_pasef_msms</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tdf_sdk</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">handle</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">precursor_list</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.tims.tims_read_pasef_msms" title="Link to this definition">¶</a></dt>
<dd><p>Read peak picked MS/MS spectra for a list of PASEF precursors from a TIMS (TDF) dataset. This function reads all
necessary PASEF frames, sums up the correspoonding scan number ranges into synthetic profile spectra for each
precursor, performs centroiding using an algorithm and parameters suggested by Bruker, and returns the resulting
MS/MS spectra (one for each precursor). The order of the returned MS/MS spectra does not necessarily match the
order in the specified precursor list.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>tdf_sdk</strong> (<em>ctypes.CDLL</em>) – Library initialized by pyTDFSDK.init_tdf_sdk.init_tdf_sdk_api().</p></li>
<li><p><strong>handle</strong> (<em>int</em>) – Handle value for TDF dataset initialized using pyTDFSDK.tims.tims_open().</p></li>
<li><p><strong>precursor_list</strong> (<em>list</em><em>[</em><em>int</em><em>] </em><em>| </em><em>numpy.array</em>) – List of precursor IDs to obtain spectra for.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Dictionary in which the key corresponds to the precursor ID and the value is a tuple of an array of m/z
values and an array of detector counts or 0 on error.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>dict | int</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pyTDFSDK.tims.tims_read_pasef_msms_for_frame">
<span class="sig-prename descclassname"><span class="pre">pyTDFSDK.tims.</span></span><span class="sig-name descname"><span class="pre">tims_read_pasef_msms_for_frame</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tdf_sdk</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">handle</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">frame_id</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.tims.tims_read_pasef_msms_for_frame" title="Link to this definition">¶</a></dt>
<dd><p>Read peak picked MS/MS spectra for all PASEF precursors in a given frame from a TIMS (TDF) dataset. This function
reads all contained PASEF precursors for a frame from the necessary PASEF frames in the same way as
pyTDFSDK.tims.tims_read_pasef_msms(). The order of the returned MS/MS does not necessarily match the order in the
specified precursor ID list.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>tdf_sdk</strong> (<em>ctypes.CDLL</em>) – Library initialized by pyTDFSDK.init_tdf_sdk.init_tdf_sdk_api().</p></li>
<li><p><strong>handle</strong> (<em>int</em>) – Handle value for TDF dataset initialized using pyTDFSDK.tims.tims_open().</p></li>
<li><p><strong>frame_id</strong> (<em>int</em>) – ID of the frame of interest.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Dictionary in which the key corresponds to the precursor ID and the value is a tuple of an array of m/z
values and an array of detector counts or 0 on error.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>dict | int</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pyTDFSDK.tims.tims_read_pasef_msms_for_frame_v2">
<span class="sig-prename descclassname"><span class="pre">pyTDFSDK.tims.</span></span><span class="sig-name descname"><span class="pre">tims_read_pasef_msms_for_frame_v2</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tdf_sdk</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">handle</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">frame_id</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.tims.tims_read_pasef_msms_for_frame_v2" title="Link to this definition">¶</a></dt>
<dd><p>Read peak picked MS/MS spectra for all PASEF precursors in a given frame from a TIMS (TDF) dataset. This function
reads all contained PASEF precursors for a frame from the necessary PASEF frames in the same way as
pyTDFSDK.tims.tims_read_pasef_msms(). The order of the returned MS/MS does not necessarily match the order in the
specified precursor ID list.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>tdf_sdk</strong> (<em>ctypes.CDLL</em>) – Library initialized by pyTDFSDK.init_tdf_sdk.init_tdf_sdk_api().</p></li>
<li><p><strong>handle</strong> (<em>int</em>) – Handle value for TDF dataset initialized using pyTDFSDK.tims.tims_open().</p></li>
<li><p><strong>frame_id</strong> (<em>int</em>) – ID of the frame of interest.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Dictionary in which the key corresponds to the precursor ID and the value is a tuple of an array of m/z
values and an array of detector counts or 0 on error.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>dict | int</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pyTDFSDK.tims.tims_read_pasef_msms_v2">
<span class="sig-prename descclassname"><span class="pre">pyTDFSDK.tims.</span></span><span class="sig-name descname"><span class="pre">tims_read_pasef_msms_v2</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tdf_sdk</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">handle</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">precursor_list</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.tims.tims_read_pasef_msms_v2" title="Link to this definition">¶</a></dt>
<dd><p>Read peak picked MS/MS spectra for a list of PASEF precursors from a TIMS (TDF) dataset. This function reads all
necessary PASEF frames, sums up the correspoonding scan number ranges into synthetic profile spectra for each
precursor, performs centroiding using an algorithm and parameters suggested by Bruker, and returns the resulting
MS/MS spectra (one for each precursor). The order of the returned MS/MS spectra does not necessarily match the
order in the specified precursor list.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>tdf_sdk</strong> (<em>ctypes.CDLL</em>) – Library initialized by pyTDFSDK.init_tdf_sdk.init_tdf_sdk_api().</p></li>
<li><p><strong>handle</strong> (<em>int</em>) – Handle value for TDF dataset initialized using pyTDFSDK.tims.tims_open().</p></li>
<li><p><strong>precursor_list</strong> (<em>list</em><em>[</em><em>int</em><em>] </em><em>| </em><em>numpy.array</em>) – List of precursor IDs to obtain spectra for.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Dictionary in which the key corresponds to the precursor ID and the value is a tuple of an array of m/z
values and an array of detector counts or 0 on error.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>dict | int</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pyTDFSDK.tims.tims_read_pasef_profile_msms">
<span class="sig-prename descclassname"><span class="pre">pyTDFSDK.tims.</span></span><span class="sig-name descname"><span class="pre">tims_read_pasef_profile_msms</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tdf_sdk</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">handle</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">precursor_list</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.tims.tims_read_pasef_profile_msms" title="Link to this definition">¶</a></dt>
<dd><p>Read quasi profile MS/MS spectra for a list of PASEF precursors from a TIMS (TDF) dataset. This function reads all
necessary PASEF frames, sums up the corresponding scan number ranges into synthetic profile spectra for each
precursor and returns the resulting quasi profile MS/MS spectra (one for each precursor). The order of the returned
MS/MS spectra does not necessarily match the order in the specified precursor ID list.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>tdf_sdk</strong> (<em>ctypes.CDLL</em>) – Library initialized by pyTDFSDK.init_tdf_sdk.init_tdf_sdk_api().</p></li>
<li><p><strong>handle</strong> (<em>int</em>) – Handle value for TDF dataset initialized using pyTDFSDK.tims.tims_open().</p></li>
<li><p><strong>precursor_list</strong> (<em>list</em><em>[</em><em>int</em><em>] </em><em>| </em><em>numpy.array</em>) – List of precursor IDs to obtain spectra for.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Dictionary in which the key corresponds to the precursor ID and the value an array of detector counts or 0
on error.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>dict | int</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pyTDFSDK.tims.tims_read_pasef_profile_msms_for_frame">
<span class="sig-prename descclassname"><span class="pre">pyTDFSDK.tims.</span></span><span class="sig-name descname"><span class="pre">tims_read_pasef_profile_msms_for_frame</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tdf_sdk</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">handle</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">frame_id</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.tims.tims_read_pasef_profile_msms_for_frame" title="Link to this definition">¶</a></dt>
<dd><p>Read quasi profile MS/MS spectra for all PASEF precursors in a given frame from a TIMS (TDF) dataset. This function
reads all contained PASEF precursors for a frame from the necessary PASEF frames in the same way as
pyTDFSDK.tims.tims_read_pasef_profile_msms(). The order of the returned MS/MS does not necessarily match the order
in the specified precursor ID list.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>tdf_sdk</strong> (<em>ctypes.CDLL</em>) – Library initialized by pyTDFSDK.init_tdf_sdk.init_tdf_sdk_api().</p></li>
<li><p><strong>handle</strong> (<em>int</em>) – Handle value for TDF dataset initialized using pyTDFSDK.tims.tims_open().</p></li>
<li><p><strong>frame_id</strong> (<em>int</em>) – ID of the frame of interest.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Dictionary in which the key corresponds to the precursor ID and the value an array of detector counts or 0
on error.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>dict | int</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pyTDFSDK.tims.tims_read_pasef_profile_msms_for_frame_v2">
<span class="sig-prename descclassname"><span class="pre">pyTDFSDK.tims.</span></span><span class="sig-name descname"><span class="pre">tims_read_pasef_profile_msms_for_frame_v2</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tdf_sdk</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">handle</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">frame_id</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.tims.tims_read_pasef_profile_msms_for_frame_v2" title="Link to this definition">¶</a></dt>
<dd><p>Read quasi profile MS/MS spectra for all PASEF precursors in a given frame from a TIMS (TDF) dataset. This function
reads all contained PASEF precursors for a frame from the necessary PASEF frames in the same way as
pyTDFSDK.tims.tims_read_pasef_profile_msms(). The order of the returned MS/MS does not necessarily match the order
in the specified precursor ID list.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>tdf_sdk</strong> (<em>ctypes.CDLL</em>) – Library initialized by pyTDFSDK.init_tdf_sdk.init_tdf_sdk_api().</p></li>
<li><p><strong>handle</strong> (<em>int</em>) – Handle value for TDF dataset initialized using pyTDFSDK.tims.tims_open().</p></li>
<li><p><strong>frame_id</strong> (<em>int</em>) – ID of the frame of interest.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Dictionary in which the key corresponds to the precursor ID and the value an array of detector counts or 0
on error.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>dict | int</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pyTDFSDK.tims.tims_read_pasef_profile_msms_v2">
<span class="sig-prename descclassname"><span class="pre">pyTDFSDK.tims.</span></span><span class="sig-name descname"><span class="pre">tims_read_pasef_profile_msms_v2</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tdf_sdk</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">handle</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">precursor_list</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.tims.tims_read_pasef_profile_msms_v2" title="Link to this definition">¶</a></dt>
<dd><p>Read quasi profile MS/MS spectra for a list of PASEF precursors from a TIMS (TDF) dataset. This function reads all
necessary PASEF frames, sums up the corresponding scan number ranges into synthetic profile spectra for each
precursor and returns the resulting quasi profile MS/MS spectra (one for each precursor). The order of the returned
MS/MS spectra does not necessarily match the order in the specified precursor ID list.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>tdf_sdk</strong> (<em>ctypes.CDLL</em>) – Library initialized by pyTDFSDK.init_tdf_sdk.init_tdf_sdk_api().</p></li>
<li><p><strong>handle</strong> (<em>int</em>) – Handle value for TDF dataset initialized using pyTDFSDK.tims.tims_open().</p></li>
<li><p><strong>precursor_list</strong> (<em>list</em><em>[</em><em>int</em><em>] </em><em>| </em><em>numpy.array</em>) – List of precursor IDs to obtain spectra for.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Dictionary in which the key corresponds to the precursor ID and the value an array of detector counts or 0
on error.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>dict | int</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pyTDFSDK.tims.tims_read_scans_v2">
<span class="sig-prename descclassname"><span class="pre">pyTDFSDK.tims.</span></span><span class="sig-name descname"><span class="pre">tims_read_scans_v2</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tdf_sdk</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">handle</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">frame_id</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">scan_begin</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">scan_end</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">initial_frame_buffer_size</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">128</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.tims.tims_read_scans_v2" title="Link to this definition">¶</a></dt>
<dd><p>Read a range of scans from a single frame. The resulting arrays are equivalent to line spectra.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>tdf_sdk</strong> (<em>ctypes.CDLL</em>) – Library initialized by pyTDFSDK.init_tdf_sdk.init_tdf_sdk_api().</p></li>
<li><p><strong>handle</strong> (<em>int</em>) – Handle value for TDF dataset initialized using pyTDFSDK.tims.tims_open().</p></li>
<li><p><strong>frame_id</strong> (<em>int</em>) – ID of the frame of interest.</p></li>
<li><p><strong>scan_begin</strong> (<em>int</em>) – Beginning scan number (corresponding to 1/K0 value) within frame.</p></li>
<li><p><strong>scan_end</strong> (<em>int</em>) – Ending scan number (corresponding to 1/K0 value) within frame (non-inclusive).</p></li>
<li><p><strong>initial_frame_buffer_size</strong> (<em>int</em>) – Initial number of buffer bytes necessary for the output, defaults to 128.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>List of tuples where each tuple contains an array of mass indices and array of detector counts or 0 on
error.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>list[tuple[numpy.array]] | int</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pyTDFSDK.tims.tims_scannum_to_oneoverk0">
<span class="sig-prename descclassname"><span class="pre">pyTDFSDK.tims.</span></span><span class="sig-name descname"><span class="pre">tims_scannum_to_oneoverk0</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tdf_sdk</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">handle</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">frame_id</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">scan_nums</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.tims.tims_scannum_to_oneoverk0" title="Link to this definition">¶</a></dt>
<dd><p>Convert (possibly non-integer) scan numbers for the mobility dimension to 1/K0 values.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>tdf_sdk</strong> (<em>ctypes.CDLL</em>) – Library initialized by pyTDFSDK.init_tdf_sdk.init_tdf_sdk_api().</p></li>
<li><p><strong>handle</strong> (<em>int</em>) – Handle value for TDF dataset initialized using pyTDFSDK.tims.tims_open().</p></li>
<li><p><strong>frame_id</strong> (<em>int</em>) – ID of the frame of interest.</p></li>
<li><p><strong>scan_nums</strong> (<em>numpy.array</em>) – Array of scan numbers to be converted to 1/K0 values.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Array of 1/K0 values.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>numpy.array</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pyTDFSDK.tims.tims_scannum_to_voltage">
<span class="sig-prename descclassname"><span class="pre">pyTDFSDK.tims.</span></span><span class="sig-name descname"><span class="pre">tims_scannum_to_voltage</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tdf_sdk</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">handle</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">frame_id</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">scan_nums</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.tims.tims_scannum_to_voltage" title="Link to this definition">¶</a></dt>
<dd><p>Convert (possibly non-integer) scan numbers for the mobility dimension to TIMS voltages.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>tdf_sdk</strong> (<em>ctypes.CDLL</em>) – Library initialized by pyTDFSDK.init_tdf_sdk.init_tdf_sdk_api().</p></li>
<li><p><strong>handle</strong> (<em>int</em>) – Handle value for TDF dataset initialized using pyTDFSDK.tims.tims_open().</p></li>
<li><p><strong>frame_id</strong> (<em>int</em>) – ID of the frame of interest.</p></li>
<li><p><strong>scan_nums</strong> (<em>numpy.array</em>) – Array of scan numbers to be converted to voltages.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Array of TIMS voltages.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>numpy.array</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pyTDFSDK.tims.tims_set_num_threads">
<span class="sig-prename descclassname"><span class="pre">pyTDFSDK.tims.</span></span><span class="sig-name descname"><span class="pre">tims_set_num_threads</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tdf_sdk</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">num_threads</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.tims.tims_set_num_threads" title="Link to this definition">¶</a></dt>
<dd><p>Set the number of threads that this DLL is allowed to use internally. The index &lt;-&gt; m/z transformation is
internally parallelized using OpenMP. This call is simply forwarded to omp_set_num_threads(). This function has no
real effect on Linux.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>tdf_sdk</strong> (<em>ctypes.CDLL</em>) – Library initialized by pyTDFSDK.init_tdf_sdk.init_tdf_sdk_api().</p></li>
<li><p><strong>num_threads</strong> (<em>int</em>) – Number of threads to use (&gt;= 1)</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pyTDFSDK.tims.tims_voltage_to_scannum">
<span class="sig-prename descclassname"><span class="pre">pyTDFSDK.tims.</span></span><span class="sig-name descname"><span class="pre">tims_voltage_to_scannum</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tdf_sdk</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">handle</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">frame_id</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">voltages</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.tims.tims_voltage_to_scannum" title="Link to this definition">¶</a></dt>
<dd><p>Convert TIMS voltages to (possibly non-integer) scan numbers for the mobility dimension.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>tdf_sdk</strong> (<em>ctypes.CDLL</em>) – Library initialized by pyTDFSDK.init_tdf_sdk.init_tdf_sdk_api().</p></li>
<li><p><strong>handle</strong> (<em>int</em>) – Handle value for TDF dataset initialized using pyTDFSDK.tims.tims_open().</p></li>
<li><p><strong>frame_id</strong> (<em>int</em>) – ID of the frame of interest.</p></li>
<li><p><strong>voltages</strong> (<em>numpy.array</em>) – Array of voltages to be converted to scan numbers.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Array of scan numbers.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>numpy.array</p>
</dd>
</dl>
</dd></dl>

</section>
<section id="module-pyTDFSDK.tsf">
<span id="pytdfsdk-tsf-module"></span><h2>pyTDFSDK.tsf module<a class="headerlink" href="#module-pyTDFSDK.tsf" title="Link to this heading">¶</a></h2>
<dl class="py function">
<dt class="sig sig-object py" id="pyTDFSDK.tsf.extract_tsf_spectrum">
<span class="sig-prename descclassname"><span class="pre">pyTDFSDK.tsf.</span></span><span class="sig-name descname"><span class="pre">extract_tsf_spectrum</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tsf_data</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">frame</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mode</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">profile_bins</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mz_encoding</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">64</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">intensity_encoding</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">64</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.tsf.extract_tsf_spectrum" title="Link to this definition">¶</a></dt>
<dd><p>Extract spectrum from TSF data with m/z and intensity arrays. Spectrum can either be centroid or quasi-profile
mode. If “raw” mode is chosen, centroid mode will automatically be used. “Centroid” mode uses
pyTDFSDK.tsf.tsf_read_line_spectrum_v2() method. “Profile” mode uses pyTDFSDK.tsf.tsf_read_profile_spectrum_v2() to
extrapolate a quasi-profile spectrum from centroid raw data.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>tsf_data</strong> (<a class="reference internal" href="#pyTDFSDK.classes.TsfData" title="pyTDFSDK.classes.TsfData"><em>pyTDFSDK.classes.TsfData</em></a>) – tsf_data object containing metadata from analysis.tsf database.</p></li>
<li><p><strong>frame</strong> (<em>int</em>) – Frame ID from the Frames table in analysis.tdf/analysis.tsf database.</p></li>
<li><p><strong>mode</strong> (<em>str</em>) – Mode command line parameter, either “profile”, “centroid”, or “raw”.</p></li>
<li><p><strong>profile_bins</strong> (<em>int</em>) – Number of bins to bin spectrum to.</p></li>
<li><p><strong>mz_encoding</strong> (<em>int</em>) – m/z encoding command line parameter, either “64” or “32”.</p></li>
<li><p><strong>intensity_encoding</strong> (<em>int</em>) – Intensity encoding command line parameter, either “64” or “32”.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Tuple of mz_array (np.array) and intensity_array (np.array).</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>tuple[numpy.array]</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pyTDFSDK.tsf.tsf_close">
<span class="sig-prename descclassname"><span class="pre">pyTDFSDK.tsf.</span></span><span class="sig-name descname"><span class="pre">tsf_close</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tdf_sdk</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">handle</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">conn</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.tsf.tsf_close" title="Link to this definition">¶</a></dt>
<dd><p>Close TSF dataset.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>tdf_sdk</strong> (<em>ctypes.CDLL</em>) – Library initialized by pyTDFSDK.init_tdf_sdk.init_tdf_sdk_api().</p></li>
<li><p><strong>handle</strong> (<em>int</em>) – Handle value for TSF dataset initialized using pyTDFSDK.tsf.tsf_open().</p></li>
<li><p><strong>conn</strong> (<em>sqlite3.Connection</em>) – SQL database connection to analysis.tsf.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Tuple of the handle and connection.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>tuple</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pyTDFSDK.tsf.tsf_has_recalibrated_state">
<span class="sig-prename descclassname"><span class="pre">pyTDFSDK.tsf.</span></span><span class="sig-name descname"><span class="pre">tsf_has_recalibrated_state</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tdf_sdk</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">handle</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.tsf.tsf_has_recalibrated_state" title="Link to this definition">¶</a></dt>
<dd><p>Check if the raw data has been recalibrated after acquisition (i.e. in the Bruker DataAnalysis software). Note that
masses and 1/K0 values in the raw data SQLite files are always in the raw calibration state, not the recalibrated
state.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>tdf_sdk</strong> (<em>ctypes.CDLL</em>) – Library initialized by pyTDFSDK.init_tdf_sdk.init_tdf_sdk_api().</p></li>
<li><p><strong>handle</strong> (<em>int</em>) – Handle value for TSF dataset initialized using pyTDFSDK.tsf.tsf_open().</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>1 if the raw data has been recalibrated after acquisition or 0 if not.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>int</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pyTDFSDK.tsf.tsf_index_to_mz">
<span class="sig-prename descclassname"><span class="pre">pyTDFSDK.tsf.</span></span><span class="sig-name descname"><span class="pre">tsf_index_to_mz</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tdf_sdk</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">handle</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">frame_id</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">indices</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.tsf.tsf_index_to_mz" title="Link to this definition">¶</a></dt>
<dd><p>Convert (possibly non-integer) index values for the mass dimension to m/z values.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>tdf_sdk</strong> (<em>ctypes.CDLL</em>) – Library initialized by pyTDFSDK.init_tdf_sdk.init_tdf_sdk_api().</p></li>
<li><p><strong>handle</strong> (<em>int</em>) – Handle value for TSF dataset initialized using pyTDFSDK.tsf.tsf_open().</p></li>
<li><p><strong>frame_id</strong> (<em>int</em>) – ID of the frame of interest.</p></li>
<li><p><strong>indices</strong> (<em>numpy.array</em>) – Array of index values to be converted to m/z values.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Array of m/z values.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>numpy.array</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pyTDFSDK.tsf.tsf_mz_to_index">
<span class="sig-prename descclassname"><span class="pre">pyTDFSDK.tsf.</span></span><span class="sig-name descname"><span class="pre">tsf_mz_to_index</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tdf_sdk</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">handle</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">frame_id</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mzs</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.tsf.tsf_mz_to_index" title="Link to this definition">¶</a></dt>
<dd><p>Convert m/z values to (possibly non-integer) index values for the mass dimension.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>tdf_sdk</strong> (<em>ctypes.CDLL</em>) – Library initialized by pyTDFSDK.init_tdf_sdk.init_tdf_sdk_api().</p></li>
<li><p><strong>handle</strong> (<em>int</em>) – Handle value for TSF dataset initialized using pyTDFSDK.tsf.tsf_open().</p></li>
<li><p><strong>frame_id</strong> (<em>int</em>) – ID of the frame of interest.</p></li>
<li><p><strong>mzs</strong> (<em>numpy.array</em>) – Array of m/z values to be converted to index values.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Array of index values.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>numpy.array</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pyTDFSDK.tsf.tsf_open">
<span class="sig-prename descclassname"><span class="pre">pyTDFSDK.tsf.</span></span><span class="sig-name descname"><span class="pre">tsf_open</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tdf_sdk</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">bruker_d_folder_name</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">use_recalibrated_state</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.tsf.tsf_open" title="Link to this definition">¶</a></dt>
<dd><p>Open TSF dataset and return a non-zero instance handle to be passed to subsequent API calls.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>tdf_sdk</strong> (<em>ctypes.CDLL</em>) – Library initialized by pyTDFSDK.init_tdf_sdk.init_tdf_sdk_api().</p></li>
<li><p><strong>bruker_d_folder_name</strong> (<em>str</em>) – Path to a Bruker .d file containing analysis.tsf.</p></li>
<li><p><strong>use_recalibrated_state</strong> (<em>bool</em>) – Whether to use recalibrated data (True) or not (False), defaults to True.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Non-zero instance handle.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>int</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pyTDFSDK.tsf.tsf_read_line_spectrum">
<span class="sig-prename descclassname"><span class="pre">pyTDFSDK.tsf.</span></span><span class="sig-name descname"><span class="pre">tsf_read_line_spectrum</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tdf_sdk</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">handle</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">frame_id</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">profile_buffer_size</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1024</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.tsf.tsf_read_line_spectrum" title="Link to this definition">¶</a></dt>
<dd><p>Read peak picked spectra for a frame from a non-TIMS (TSF) dataset.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>tdf_sdk</strong> (<em>ctypes.CDLL</em>) – Library initialized by pyTDFSDK.init_tdf_sdk.init_tdf_sdk_api().</p></li>
<li><p><strong>handle</strong> (<em>int</em>) – Handle value for TSF dataset initialized using pyTDFSDK.tsf.tsf_open().</p></li>
<li><p><strong>frame_id</strong> (<em>int</em>) – ID of the frame of interest.</p></li>
<li><p><strong>profile_buffer_size</strong> (<em>int</em>) – Initial number of buffer bytes necessary for the output, defaults to 1024.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Tuple containing an array of index values for the mass dimension and an array of detector counts or -1 on
error.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>tuple[numpy.array] | int</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pyTDFSDK.tsf.tsf_read_line_spectrum_v2">
<span class="sig-prename descclassname"><span class="pre">pyTDFSDK.tsf.</span></span><span class="sig-name descname"><span class="pre">tsf_read_line_spectrum_v2</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tdf_sdk</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">handle</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">frame_id</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">profile_buffer_size</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1024</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.tsf.tsf_read_line_spectrum_v2" title="Link to this definition">¶</a></dt>
<dd><p>Read peak picked spectra for a frame from a non-TIMS (TSF) dataset.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>tdf_sdk</strong> (<em>ctypes.CDLL</em>) – Library initialized by pyTDFSDK.init_tdf_sdk.init_tdf_sdk_api().</p></li>
<li><p><strong>handle</strong> (<em>int</em>) – Handle value for TSF dataset initialized using pyTDFSDK.tsf.tsf_open().</p></li>
<li><p><strong>frame_id</strong> (<em>int</em>) – ID of the frame of interest.</p></li>
<li><p><strong>profile_buffer_size</strong> (<em>int</em>) – Initial number of buffer bytes necessary for the output, defaults to 1024.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Tuple containing an array of index values for the mass dimension and an array of detector counts or -1 on
error.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>tuple[numpy.array] | int</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pyTDFSDK.tsf.tsf_read_line_spectrum_with_width_v2">
<span class="sig-prename descclassname"><span class="pre">pyTDFSDK.tsf.</span></span><span class="sig-name descname"><span class="pre">tsf_read_line_spectrum_with_width_v2</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tdf_sdk</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">handle</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">frame_id</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">profile_buffer_size</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1024</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.tsf.tsf_read_line_spectrum_with_width_v2" title="Link to this definition">¶</a></dt>
<dd><p>Read peak picked spectra with peak width for a frame from a non-TIMS (TSF) dataset.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>tdf_sdk</strong> (<em>ctypes.CDLL</em>) – Library initialized by pyTDFSDK.init_tdf_sdk.init_tdf_sdk_api().</p></li>
<li><p><strong>handle</strong> (<em>int</em>) – Handle value for TSF dataset initialized using pyTDFSDK.tsf.tsf_open().</p></li>
<li><p><strong>frame_id</strong> (<em>int</em>) – ID of the frame of interest.</p></li>
<li><p><strong>profile_buffer_size</strong> (<em>int</em>) – Initial number of buffer bytes necessary for the output, defaults to 1024.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Tuple containing an array of index values for the mass dimension, an array of detector counts, and an
array of widths or -1 on error.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>tuple[numpy.array] | int</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pyTDFSDK.tsf.tsf_read_profile_spectrum">
<span class="sig-prename descclassname"><span class="pre">pyTDFSDK.tsf.</span></span><span class="sig-name descname"><span class="pre">tsf_read_profile_spectrum</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tdf_sdk</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">handle</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">frame_id</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">profile_buffer_size</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1024</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.tsf.tsf_read_profile_spectrum" title="Link to this definition">¶</a></dt>
<dd><p>Read profile spectra for a frame from a non-TIMS (TSF) dataset.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>tdf_sdk</strong> (<em>ctypes.CDLL</em>) – Library initialized by pyTDFSDK.init_tdf_sdk.init_tdf_sdk_api().</p></li>
<li><p><strong>handle</strong> (<em>int</em>) – Handle value for TSF dataset initialized using pyTDFSDK.tsf.tsf_open().</p></li>
<li><p><strong>frame_id</strong> (<em>int</em>) – ID of the frame of interest.</p></li>
<li><p><strong>profile_buffer_size</strong> (<em>int</em>) – Initial number of buffer bytes necessary for the output, defaults to 1024.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Tuple containing an array of index values for the mass dimension and an array of detector counts or -1 on
error.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>tuple[numpy.array] | int</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pyTDFSDK.tsf.tsf_read_profile_spectrum_v2">
<span class="sig-prename descclassname"><span class="pre">pyTDFSDK.tsf.</span></span><span class="sig-name descname"><span class="pre">tsf_read_profile_spectrum_v2</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tdf_sdk</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">handle</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">frame_id</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">profile_buffer_size</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1024</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.tsf.tsf_read_profile_spectrum_v2" title="Link to this definition">¶</a></dt>
<dd><p>Read profile spectra for a frame from a non-TIMS (TSF) dataset.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>tdf_sdk</strong> (<em>ctypes.CDLL</em>) – Library initialized by pyTDFSDK.init_tdf_sdk.init_tdf_sdk_api().</p></li>
<li><p><strong>handle</strong> (<em>int</em>) – Handle value for TSF dataset initialized using pyTDFSDK.tsf.tsf_open().</p></li>
<li><p><strong>frame_id</strong> (<em>int</em>) – ID of the frame of interest.</p></li>
<li><p><strong>profile_buffer_size</strong> (<em>int</em>) – Initial number of buffer bytes necessary for the output, defaults to 1024.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Tuple containing an array of index values for the mass dimension and an array of detector counts or -1 on
error.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>tuple[numpy.array] | int</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pyTDFSDK.tsf.tsf_set_num_threads">
<span class="sig-prename descclassname"><span class="pre">pyTDFSDK.tsf.</span></span><span class="sig-name descname"><span class="pre">tsf_set_num_threads</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tdf_sdk</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">num_threads</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.tsf.tsf_set_num_threads" title="Link to this definition">¶</a></dt>
<dd><p>Set the number of threads that this DLL is allowed to use internally. The index &lt;-&gt; m/z transformation is
internally parallelized using OpenMP. This call is simply forwarded to omp_set_num_threads(). This function has no
real effect on Linux.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>tdf_sdk</strong> (<em>ctypes.CDLL</em>) – Library initialized by pyTDFSDK.init_tdf_sdk.init_tdf_sdk_api().</p></li>
<li><p><strong>num_threads</strong> (<em>int</em>) – Number of threads to use (&gt;= 1)</p></li>
</ul>
</dd>
</dl>
</dd></dl>

</section>
<section id="module-pyTDFSDK.util">
<span id="pytdfsdk-util-module"></span><h2>pyTDFSDK.util module<a class="headerlink" href="#module-pyTDFSDK.util" title="Link to this heading">¶</a></h2>
<dl class="py function">
<dt class="sig sig-object py" id="pyTDFSDK.util.bin_profile_spectrum">
<span class="sig-prename descclassname"><span class="pre">pyTDFSDK.util.</span></span><span class="sig-name descname"><span class="pre">bin_profile_spectrum</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">mz_array</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">intensity_array</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">profile_bins</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mz_encoding</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.util.bin_profile_spectrum" title="Link to this definition">¶</a></dt>
<dd><p>Bin profile mode spectrum into N number of bins.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>mz_array</strong> (<em>numpy.array</em>) – Array containing m/z values.</p></li>
<li><p><strong>intensity_array</strong> (<em>numpy.array</em>) – Array containing intensity values.</p></li>
<li><p><strong>profile_bins</strong> (<em>int</em>) – Number of bins to bin spectrum to.</p></li>
<li><p><strong>mz_encoding</strong> (<em>int</em>) – m/z encoding command line parameter, either “64” or “32”.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Tuple of binned_mz_array (np.array) and binned_intensity_array (np.array).</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>tuple[numpy.array]</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pyTDFSDK.util.call_conversion_func">
<span class="sig-prename descclassname"><span class="pre">pyTDFSDK.util.</span></span><span class="sig-name descname"><span class="pre">call_conversion_func</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tdf_sdk</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">handle</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">frame_id</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">input_data</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">func</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.util.call_conversion_func" title="Link to this definition">¶</a></dt>
<dd><p>Decorator for other conversion related functions.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>tdf_sdk</strong> (<em>ctypes.CDLL</em>) – Instance of TDF-SDK.</p></li>
<li><p><strong>handle</strong> (<em>int</em>) – Handle value for TDF/TSF dataset initialized using pyTDFSDK.tims.tims_open() or
pyTDFSDK.tsf.tsf_open().</p></li>
<li><p><strong>frame_id</strong> (<em>int</em>) – ID of the frame of interest.</p></li>
<li><p><strong>input_data</strong> (<em>numpy.array</em>) – Array to be converted.</p></li>
<li><p><strong>func</strong> (<em>function</em>) – Conversion function from TDF-SDK to pass through decorator.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Array of converted values equal in size to the input_data array.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>numpy.array</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pyTDFSDK.util.get_centroid_status">
<span class="sig-prename descclassname"><span class="pre">pyTDFSDK.util.</span></span><span class="sig-name descname"><span class="pre">get_centroid_status</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">mode</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">exclude_mobility</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.util.get_centroid_status" title="Link to this definition">¶</a></dt>
<dd><p>Use “mode” command line parameter to determine whether output data is centroided in psims compatible format.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>mode</strong> (<em>str</em>) – Mode command line parameter, either “profile”, “centroid”, or “raw”.</p></li>
<li><p><strong>exclude_mobility</strong> (<em>bool</em><em> | </em><em>None</em>) – Whether to include mobility data in the output files, defaults to None.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Dictionary containing standard spectrum data.</p>
</dd>
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>Tuple of (centroided status (bool), exclude_mobility status (bool))</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p>tuple[bool]</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pyTDFSDK.util.get_encoding_dtype">
<span class="sig-prename descclassname"><span class="pre">pyTDFSDK.util.</span></span><span class="sig-name descname"><span class="pre">get_encoding_dtype</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">encoding</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.util.get_encoding_dtype" title="Link to this definition">¶</a></dt>
<dd><p>Use “encoding” command line parameter to determine numpy dtype.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>encoding</strong> (<em>int</em>) – Encoding command line parameter, either “64” or “32”.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Numpy dtype, either float64 or float32</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>numpy.dtype</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pyTDFSDK.util.get_maldi_coords">
<span class="sig-prename descclassname"><span class="pre">pyTDFSDK.util.</span></span><span class="sig-name descname"><span class="pre">get_maldi_coords</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">data</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">maldiframeinfo_dict</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyTDFSDK.util.get_maldi_coords" title="Link to this definition">¶</a></dt>
<dd><p>Get tuple of MALDI coordinates from analysis.tsf/analysis.tdf metadata.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>data</strong> (<a class="reference internal" href="#pyTDFSDK.classes.TsfData" title="pyTDFSDK.classes.TsfData"><em>pyTDFSDK.classes.TsfData</em></a><em> | </em><a class="reference internal" href="#pyTDFSDK.classes.TdfData" title="pyTDFSDK.classes.TdfData"><em>pyTDFSDK.classes.TdfData</em></a>) – Object containing metadata from analysis.tsf/analysis.tdf database.</p></li>
<li><p><strong>maldiframeinfo_dict</strong> (<em>dict</em>) – A row from the MaldiFrameInfo table in analysis.tsf/analysis.tdf database.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>x-y (or x-y-z if available) coordinates for the current spectrum.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>tuple[int]</p>
</dd>
</dl>
</dd></dl>

</section>
<section id="module-pyTDFSDK">
<span id="module-contents"></span><h2>Module contents<a class="headerlink" href="#module-pyTDFSDK" title="Link to this heading">¶</a></h2>
</section>
</section>


          </div>
          
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="Main">
        <div class="sphinxsidebarwrapper">
<h1 class="logo"><a href="index.html">pyTDFSDK</a></h1>









<search id="searchbox" style="display: none" role="search">
    <div class="searchformwrapper">
    <form class="search" action="search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" placeholder="Search"/>
      <input type="submit" value="Go" />
    </form>
    </div>
</search>
<script>document.getElementById('searchbox').style.display = "block"</script><h3>Navigation</h3>

<div class="relations">
<h3>Related Topics</h3>
<ul>
  <li><a href="index.html">Documentation overview</a><ul>
  </ul></li>
</ul>
</div>








        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="footer">
      &#169;2024, Gordon T. Luu.
      
      |
      Powered by <a href="https://www.sphinx-doc.org/">Sphinx 8.0.2</a>
      &amp; <a href="https://alabaster.readthedocs.io">Alabaster 1.0.0</a>
      
      |
      <a href="_sources/pyTDFSDK.rst.txt"
          rel="nofollow">Page source</a>
    </div>

    

    
  </body>
</html>